package com.alveole.servlet;

import java.io.IOException;

import javax.inject.Inject;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alveole.events.handlers.BrowserEventHandler;
import com.alveole.objects.BrowserSession;

@WebServlet("/service")    
public class AlveoleServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Inject
    BrowserEventHandler browserEventHandler;                                        

	@Inject
    BrowserSession browserSession;                                        


	
	@Override
	protected void service(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

	
		response.getWriter().write(
				browserEventHandler.process(browserSession, request.getParameterMap())
				);

	}


}
